/* 清除默认样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Arial", sans-serif;
}
/* 导航栏样式 */
.navbar {
  background-color: #1c99ca;
  padding: 15px 0; /* 增加顶部和底部的填充 */
  position: sticky; /* 固定导航栏 */
  top: 0; /* 导航栏固定在顶部 */
  z-index: 1000; /* 确保导航栏在其他内容上方 */
}
.nav-container {
  width: 90%;
  max-width: 2000px;
  margin: 0 auto; /* 水平居中 */
  display: flex; /* 使用 Flexbox 布局 */
  justify-content: space-between; /* 两端对齐 */
  align-items: center; /* 垂直居中 */
}
.logo {
  color: rgb(223, 235, 91);
  font-size: 24px;
  font-weight: bold; /* 加粗字体 */
}
.nav-links {
  display: flex; /* 使用 Flexbox 布局 */
  gap: 25px; /* 链接之间的间距 */
}
.nav-links a {
  color: aquamarine;
  text-decoration: none; /* 去除下划线 */
  font-size: 16px;
  padding: 5px 0; /* 增加上下填充 */
  position: relative; /* 相对定位 */
}
.nav-links a::after {
  content: ""; /* 伪元素内容为空 */
  position: absolute; /* 绝对定位 */
  bottom: 0; /* 底部对齐 */
  left: 0; /* 左侧对齐 */
  width: 0; /* 初始宽度为0 */
  height: 2px; /* 下划线的高度 */
  background-color: #f3f3f3; /* 下划线的颜色 */
  transition: width 0.3s ease; /* 过渡效果 */
}
.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%; /* 鼠标悬停时宽度为100% */
}
.nav-links a.active {
  color: #3ede6b; /* 激活链接的颜色 */
}
/* 自我介绍区域 */
.intro-container {
  min-height: calc(100vh - 80px); /* 减去导航栏高度 */
  background-color: #f5f5f5;
  padding: 50px 0; /* 上下填充 */
  display: flex;
  justify-content: center; /* 水平居中 */
  align-items: center; /* 垂直居中 */
}
.intro-card {
  background-color: rgb(82, 196, 228);
  width: 90%; /* 卡片宽度 */
  max-width: 800px;
  padding: 40px; /* 卡片内边距 */
  border-radius: 10px; /* 圆角 */
  box-shadow: 0 20px 5px rgba(0, 0, 0, 0.1); /* 阴影 */
  display: flex; /*每个元素弹性的*/
  align-items: center;
  gap: 30px; /* 图片和文本之间的间距 */
}
/* 头像 */
.avatar img {
  width: 150px; /* 头像大小 */
  height: 150px;
  border-radius: 50%; /* 圆形头像 */
  object-fit: cover; /* 保持图片比例 */
  border: #1c99ca 5px solid; /* 头像边框 */
}

/* 文章css */
.page-header {
  margin-bottom: 3rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #ababab;
  text-align: center;
}
.page-header h1 {
  font-size: 2.5rem;
  color: chocolate;
  margin-bottom: 1rem;
}
.page-header p {
  font-size: 1.2rem;
  color: #666;
}
/* 默认条件下 */
.article-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}
/* 当屏幕宽度大于等于 768px 时（电脑端），一排展示两篇文章 */
@media (min-width: 768px) {
  .article-container {
    grid-template-columns: repeat(2, minmax(300px, 1fr));
  }
}
.article-card {
  background-color: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.5s ease forwards;
}
/* 卡片渐入动画 */
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* 鼠标悬浮效果 */
.article-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.1);
}
.article-image {
  height: 200px;
  overflow: hidden;
}
.article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.3s ease;
}
.article-card:hover .article-image img {
  transform: scale(1.1);
}
.article-content {
  padding: 1.5rem;
}
.article-title {
  font-size: 1.8rem;
  font-weight: bold;
  margin-bottom: 1rem;
  color: rgb(41, 42, 42);
}
.article-card:hover .article-title {
  color: #2ba9db;
}
.article-meta {
  display: flex;
  gap: 1rem;
  font-size: 1.2rem;
  color: #666;
  margin-bottom: 1rem;
}
.article-excerpt {
  line-height: 1.6;
  color: #333;
  margin-bottom: 1.5rem;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card:hover .article-excerpt {
  color: #cd3838;
}
.read-more {
  display: inline-block;
  color: #000;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}
.read-more:hover {
  color: #cd3838;
  padding-left: 5px;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .articles-container {
    grid-template-columns: 1fr;
  }

  .page-header h1 {
    font-size: 2rem;
  }
}

/* 文章详情弹窗样式 */
.article-detail-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  z-index: 1000;
  padding: 2rem 0;
  overflow-y: auto;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.article-detail-modal .modal-content {
  width: 100%;
  max-width: 800px;
  background-color: #fff;
  border-radius: 10px;
  overflow: hidden;
  transform: translateY(30px) scale(0.98);
  transition: all 0.3s ease;
  margin: 0 1rem;
}

/* 弹窗进入动画 */
.article-detail-modal .modal-content.modal-enter {
  transform: translateY(0) scale(1);
}

.article-detail-modal.modal-enter {
  opacity: 1;
}

/* 关闭按钮 */
.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  z-index: 10;
}

.close-btn:hover {
  background-color: rgba(0, 0, 0, 0.8);
  transform: rotate(90deg);
}

/* 详情页封面 */
.detail-cover {
  width: 100%;
  height: 400px;
  position: relative;
}

.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 详情页标题和元数据 */
.detail-header {
  padding: 2rem;
  border-bottom: 1px solid #eee;
}

.detail-title {
  font-size: 2rem;
  color: #333;
  margin-bottom: 1rem;
}

.detail-meta {
  display: flex;
  gap: 1.5rem;
  color: #888;
  font-size: 0.95rem;
}

/* 详情页内容 */
.detail-content {
  padding: 2rem;
  line-height: 1.8;
  color: #555;
  font-size: 1.1rem;
}

.detail-content p {
  margin-bottom: 1.5rem;
}

.detail-content p:last-child {
  margin-bottom: 0;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .articles-container {
    grid-template-columns: 1fr;
  }

  .page-header h1 {
    font-size: 2rem;
  }

  .detail-cover {
    height: 300px;
  }

  .detail-title {
    font-size: 1.6rem;
  }

  .detail-header,
  .detail-content {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .detail-cover {
    height: 200px;
  }

  .articles-page {
    padding: 1rem;
  }
}

/* 居中 */
.popup {
  display: flex;
  align-items: center;
  flex-direction: column;
  box-sizing: border-box;
  width: 80%;
  max-width: 1400px;
  min-width: 400px;
  height: 600px;
  background: #f3f3f3;

  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 5%;
  /* 当内容超出高度时，自动显示垂直滚动条 */
  overflow-y: auto;
}
/* 遮罩层 */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5); /* 半透明黑色背景 */
}
